import { createContext } from 'react';
import React,{useContext} from 'react';



const myContext = createContext();
const DEMO = ()=>{
  const data = useContext(myContext)
  return(
    <div>
      {data}
    </div>
  )
}
const App = (props)=>{
  return (
    <myContext.Provider value='1000'>
      {/* 包含的组件都能拿到value值 */}
      <DEMO />
    </myContext.Provider>
  )
}
export default App;
